﻿@using MvcContrib.UI.Pager
@using MvcContrib.UI.Grid 
@using MvcContrib.Pagination 

@model ENail.Portal.Web.Models.ReceiptViewModel

@{
    ViewBag.Title = "Receipt";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div id="container_home_main" >
<div style="background-color:#edd2ca;width:645px;height:15px;text-align:center;padding:5px"> <font style="color:#5b362c;font-weight:bold">@ViewBag.Title</font> </div>
<div id="container_content">

    @using (Html.BeginForm())
    {
    <table>
        <tr>
            <td>Customer:</td>
            <td>@Model.CustomerName</td>
        </tr>
        <tr>
            <td>Start Time:</td>
            <td>@Model.StartTime</td>
        </tr>
        <tr>
            <td>End Time:</td>
            <td>@DateTime.Now</td>
        </tr>
    </table>
        
    <table>
        <tr>
            <td>@Html.ValidationSummary()</td>
        </tr>
    </table>

    <table>
        <tr>
            <td>
                @Html.Grid(Model.ReceiptItems).Columns((column) =>
                                                {
                                                    //column.For(x => Html.CheckBox("chkIsSelected", x.IsSelected))
                                                    //        .Named("");
                                                    column.For(x => x.NailServiceName)
                                                            .Named("Service")
                                                            .Attributes(width => "250px");
                                                    column.For(x => x.EmployeeName)
                                                            .Named("Technician")
                                                            .Attributes(width => "200px");
                                                    column.For(x => x.Price)
                                                            .Named("Price")
                                                            .Attributes(width => "150px")
                                                            .Format("{0:c}");
                                                }
                                        ).Attributes(@class => "grid"
                                        ).HeaderRowAttributes(new Dictionary<string, object> { { "class", "gridheaderrow" } }
                                        ).RowAttributes(row => new Dictionary<string, object> { { "onclick", "document.location='" + Url.Action("Update", new { Id = row.Item.Id }) + "'"} })
            </td>
        </tr>
    </table>
        
    <table>
        <tr>
            <td width="370px"></td>
            <td align="right">Sub Total:</td>
            <td>@Html.TextBoxFor(x => x.SubTotal, new { value = "10" })</td>
        </tr>
        <tr>
            <td></td>
            <td>Discount:</td>
            <td>@Html.TextBoxFor(x => x.Discount)</td>
        </tr>
        <tr>
            <td></td>
            <td>Tax:</td>
            <td>@Html.TextBoxFor(x => x.Tax)%</td>
        </tr>
        <tr>
            <td></td>
            <td>Total:</td>
            <td>@Html.TextBoxFor(x => x.Total)</td>
        </tr>
    </table>
                
    <table>
        <tr>
            <td><input type="button" value="Back" onclick="document.location='@Url.Action("List")'" /></td>
            <td><input type="button" value="Update" onclick="document.forms(0).submit()" /></td>
            <td><input type="button" value="Close" onclick="document.forms(1).submit()" /></td>
        </tr>
    </table>
    }

    @using (Html.BeginForm("Close", "Billing", new { id = Model.RegistrationId }))
    {
    }
            </div>
	      </div>
          <div id="container_home_right">@{
            Html.RenderAction("InitializeTask");   
        }
</div>
